#ifndef EQCTRLWIDGET_H
#define EQCTRLWIDGET_H

#include <QWidget>
#include <QGridLayout>
#include <QSlider>
#include <QLabel>
#include <QComboBox>
#include <QDoubleSpinBox>
#include <QSpinBox>
#include <QCheckBox>
#include <QGroupBox>
#include "dm/dmstruct.h"
#include "qvaluespinbox.h"

class EqCtrlWidget : public QWidget
{
    Q_OBJECT
public:
    explicit EqCtrlWidget(const EQ &initArg, const int &flag, const bool &showLabel = false, QWidget *parent = nullptr);
    EQ getCurrentValue() const;
public slots:
    void reset();
    void setFreqQain(const std::pair<double, double> &pair);
signals:
    void stateChanged(const EQ &);
    void qValueChanged(const int &bw);
protected slots:
    void init();
    void sliderValueChanged(const int &value);
private slots:
    void emitCurrentValue();
private:
    const EQ m_initArg;
    const int m_flag;
private:
    QLabel *textLabel;
    QLabel *freqLabel;
    QLabel *qLabel;
    QLabel *gainLabel;
    QLabel *typeLabel;
    QCheckBox *checkBox;
    QSlider *slider;
    QSpinBox *freqSpinBox;
    QValueSpinBox *qSpinBox;
    QDoubleSpinBox *gainSpinBox;
    QComboBox *typeComboBox;
};

#endif // EQCTRLWIDGET_H
